// Copyright (c) 2020-present, INSPUR Co, Ltd. All rights reserved.
// This source code is licensed under Apache 2.0 License.

#pragma once

#include "pure_mem/key_index/abstract_tree.h"
#include <pure_mem/key_index/art/rowex/art_tree.h>

namespace rocksdb {
/**
 * 基于开源libart项目的ART树的实现，无并发控制机制，实现的　ITree　索引类．
 * 该类使用　lib_art 目录下的逻辑，需要实现对应的接口
 * 
 */
class LibArtTree : public ITree {

public:
  LibArtTree();
  ~LibArtTree() override;
  bool insertNoReplace(const Slice &key, void *curNode,
                       void *&retNode) override;
  void *getGT(const Slice &key) override;
  void *getGE(const Slice &key) override;

private:
  art_rowex::Tree *tree_;
};

} // namespace rocksdb